/**
 * Copyright 2020 Huawei Technologies Co., Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef TF_UTIL_H_
#define TF_UTIL_H_

#include "util/util.h"
#include "proto/tensorflow/types.pb.h"

using TFDataType = ::domi::tensorflow::DataType;
namespace aicpu {
/**
 * Generate the unique id by timestamp
 * @return uniqueId
 */
uint64_t GenerateUniqueId();

/**
 * Convert the Ge data to tf data type
 * @param data_type ge's data type
 * @param is_ref whether the base data type is ref
 * @return tf's data type
 */
TFDataType ConvertGeDataType2TfDataType(ge::DataType data_type, bool is_ref=false);

/**
 * Convert string to TFDataType.
 * @param elem element attr
 * @param data_type data type
 * @return TFDataType
 */
bool ConvertString2TfDataType(const std::string &elem, TFDataType &data_type);
}
#endif // TF_UTIL_H_